package com.example.mobile2021606145zbq0402homework;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

    private TextView tvMainTitle;
    private Button btnMainNext;
    private ImageView ivMainTu;
    int i=0;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        btnMainNext.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                switch (i) {
                    case 0:ivMainTu.setImageResource(R.drawable.line01_01);i++;break;
                    case 1:ivMainTu.setImageResource(R.drawable.line01_02);i++;break;
                    case 2:ivMainTu.setImageResource(R.drawable.line01_03);i++;break;
                    case 3:ivMainTu.setImageResource(R.drawable.line01_04);i++;break;
                    case 4:ivMainTu.setImageResource(R.drawable.line01_05);i++;break;
                    case 5:ivMainTu.setImageResource(R.drawable.line01_06);i++;break;
                }
                if (i>=6)
                    i=0;
            }
        });
    }

    private void initView() {
        tvMainTitle = (TextView) findViewById(R.id.tv_main_title);
        btnMainNext = (Button) findViewById(R.id.btn_main_next);
        ivMainTu = (ImageView) findViewById(R.id.iv_main_tu);
    }
}